
//-----------------------------------------------------------------------------
// Global variables
//-----------------------------------------------------------------------------
float4x4 mWorldViewProj;  // World * View * Projection transformation
float4x4 mWorld;  // World * View * Projection transformation
float3 LightDir;
float4 ambientLightColor;
float4 diffuseLightColor;
struct VS_OUTPUT
{
    float4 Position   : POSITION;   // vertex position 
    float4 Diffuse    : COLOR0;     // vertex diffuse color
	float3 TexCoord0  : TEXCOORD0;
};
struct VS_INPUT
{
    float3 Position   : POSITION;   // vertex position 
    float4 Diffuse    : COLOR0;     // vertex diffuse color
    float3 Normal     : NORMAL;     // vertex diffuse color
	float3 TexCoord0	  : TEXCOORD0;
};


//-----------------------------------------------------------------------------
// Name: Ripple
// Type: Vertex shader                                      
// Desc: This shader ripples the vertices
//-----------------------------------------------------------------------------
VS_OUTPUT VS_Main( VS_INPUT IN )
{
	VS_OUTPUT Output;
	Output.Position = mul(float4(IN.Position, 1.0), mWorldViewProj); 
	float3 worldNormal = (mul(float4(IN.Normal,1.0), mWorld)).xyz; 
	float diffuseIntensity = saturate( dot(-LightDir, worldNormal)); 
	Output.Diffuse = diffuseLightColor * diffuseIntensity*(1 - ambientLightColor) + ambientLightColor; 
	Output.TexCoord0 = IN.TexCoord0;
	return Output;
}
